<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>Hello mdui</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<script type="text/javascript" src="../../statics/common/js/header.js"></script>
		<!--标准mdui.css-->
		<link rel="stylesheet" href="../../statics/mdui/css/mdui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="../../statics/mdui/css/app.css"/>
	</head>
	<body>
		<header class="mdui-bar mdui-bar-nav">
			<a class="mdui-action-back mdui-icon mdui-icon-left-nav mdui-pull-left"></a>
			<h1 class="mdui-title">列表带input类控件</h1>
		</header>
		<div class="mdui-content">
			<div class="mdui-card">
				<ul class="mdui-table-view">
					<li class="mdui-table-view-cell">
						card（圆角列表）
						<div id="M_Toggle" class="mdui-switch mdui-active">
							<div class="mdui-switch-handle"></div>
						</div>
					</li>
					<li class="mdui-table-view-cell">
						Item 1
						<button type="button" class="mdui-btn">
							Button
						</button>
					</li>
					<li class="mdui-table-view-cell">
						Item 2
						<button type="button" class="mdui-btn mdui-btn-primary">
							Button
						</button>
					</li>
					<li class="mdui-table-view-cell">
						Item 3
						<div class="mdui-switch mdui-active">
							<div class="mdui-switch-handle"></div>
						</div>
					</li>
					<li class="mdui-table-view-cell">
						Item 4
						<div class="mdui-switch mdui-switch-blue mdui-switch-mini mdui-active">
							<div class="mdui-switch-handle"></div>
						</div>
					</li>
					<li class="mdui-table-view-cell mdui-radio mdui-left">
						<input name="radio" type="radio">Item 5
					</li>
					<li class="mdui-table-view-cell mdui-radio mdui-left">
						<input name="radio" type="radio">Item 6
					</li>
					<li class="mdui-table-view-cell mdui-checkbox mdui-left">
						<input name="checkbox" type="checkbox">Item 7
					</li>
					<li class="mdui-table-view-cell mdui-checkbox mdui-left">
						<input name="checkbox" type="checkbox">Item 8
					</li>
				</ul>
			</div>
		</div>
	</body>
	<script src="../../statics/mdui/js/mdui.min.js"></script>
	<script>
		mdui.init({
			swipeBack:true //启用右滑关闭功能
		});
		
		//圆角列表开关处理
		document.getElementById("M_Toggle").addEventListener('toggle',function (e) {
			var isActive = e.detail.isActive;
			var table = document.querySelector('.mdui-table-view');
			var card = document.querySelector('.mdui-card');
			if (isActive) {
				card.appendChild(table);
				card.style.display = '';
			} else {
				var content = document.querySelector('.mdui-content');
				content.insertBefore(table, card);
				card.style.display = 'none';
			}
		});
	</script>
</html>